<?php
# ***** BEGIN LICENSE BLOCK *****
# This file is part of "myWiWall".
# Copyright (c) 2007-2008 CRP Henri Tudor and contributors.
# All rights reserved.
#
# "myWiWall" is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as published by
# the Free Software Foundation.
# 
# "myWiWall" is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with "myWiWall"; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#
# ***** END LICENSE BLOCK *****


/**
 * Class for exception related to services delivered to the outside world.
 * 
 * @package mywiwall.exceptions
 * @author Yannick Naudet <yannick.naudet@tudor.lu>
 */
class ServiceException extends MwwException {
 	
	const SERV_AUTH = 'You must be authenticated to consume a service.';
 	
/**
 * Creates a new instance of ServiceException.
 * 
 * @param string $loc The location of the exception in an MVC context.
 * @param string $service The name of the concerned service.
 * @param string $message The message. Predefined messages of the class can be used.
 * @param Exception $parentException An exception which is the cause of this one (not mandatory).
 */
public function __construct($loc, $service, $message, Exception $parentException=NULL) {
	
	if ($service != NULL && $service != '') {
		$message = 'Problem with the service '.$service.': '.$message; 
	}
		else
	{
		$message = 'Problem with a service: '.$message;
	}
	
	parent::__construct($loc, $message, $parentException);
}
}
?>
